﻿#region << 文 件 说 明 >>
/*----------------------------------------------------------------
// 文件名称：ViewModelLocator
// 创 建 者：杨程
// 创建时间：2021/9/2 10:40:53
// 文件版本：V1.0.0
// ===============================================================
// 功能描述：
//		
//
//----------------------------------------------------------------*/
#endregion

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using V.CodeGenerator.CreateCodes;
using V.CodeGenerator.CreateCodes.Interface;
using V.CodeGenerator.DataAccess;
using Vampirewal.Core;
using Vampirewal.Core.Components;
using Vampirewal.Core.Interface;
using Vampirewal.Core.IoC;
using Vampirewal.Core.OperationExcelService;
using Vampirewal.Core.SimpleMVVM;

namespace V.CodeGenerator.ViewModel
{
    public class ViewModelLocator:VampirewalViewModelLocator
    {
        
        public override void InitLocator()
        {
            
        }

        public override void InitRegisterService()
        {
            VampirewalIoC.GetInstance().RegisterService<IAppConfig, VampirewalConfig>();
            VampirewalIoC.GetInstance().RegisterService<IDataContext, VDataContext>();
            VampirewalIoC.GetInstance().RegisterService<ILogger, VampirewalLog>();
            VampirewalIoC.GetInstance().RegisterService<IDialogMessage, VampirewalDialog>();
            VampirewalIoC.GetInstance().RegisterService<IOperationExcelService, VampirewalOperationExcelService>();
            VampirewalIoC.GetInstance().RegisterService<IValidationService, VampirewalValidationService>();
            VampirewalIoC.GetInstance().RegisterService<ICreateCode, VCodeGenerator>();
        }

        public override void InitRegisterViewModel()
        {
            //CustomIoC.Instance.Register<MainViewModel>();
            //CustomIoC.Instance.Register<ModelEditViewModel>();
            //CustomIoC.Instance.Register<LoginViewModel>();
            //CustomIoC.Instance.Register<AddProjectViewModel>();
            //CustomIoC.Instance.Register<AddOrEditModelEditViewModel>();
            //CustomIoC.Instance.Register<Configuration_ProjectBaseInfoViewModel>();
            //CustomIoC.Instance.Register<Configuration_ModelPocoViewModel>();
            //CustomIoC.Instance.Register<Configuration_ModuleFunctionViewModel>();
            //CustomIoC.Instance.Register<AddOrEditModelPocoViewModel>();
        }

        public LoginViewModel LoginViewModel => VampirewalIoC.GetInstance().GetInstance<LoginViewModel>();
        public AddProjectViewModel AddProjectViewModel => VampirewalIoC.GetInstance().GetInstance<AddProjectViewModel>();


        public MainViewModel MainViewModel => VampirewalIoC.GetInstance().GetInstance<MainViewModel>();

        public ModelEditViewModel ModelEditViewModel => VampirewalIoC.GetInstance().GetInstance<ModelEditViewModel>();

        public AddOrEditModelEditViewModel AddOrEditModelEditViewModel => VampirewalIoC.GetInstance().GetInstance<AddOrEditModelEditViewModel>();

        #region 配置页的ViewModel
        public Configuration_ProjectBaseInfoViewModel Configuration_ProjectBaseInfoViewModel => VampirewalIoC.GetInstance().GetInstance<Configuration_ProjectBaseInfoViewModel>();

        public Configuration_ModelPocoViewModel Configuration_ModelPocoViewModel => VampirewalIoC.GetInstance().GetInstance<Configuration_ModelPocoViewModel>();

        public Configuration_ModuleFunctionViewModel Configuration_ModuleFunctionViewModel => VampirewalIoC.GetInstance().GetInstance<Configuration_ModuleFunctionViewModel>();

        public AddOrEditModelPocoViewModel AddOrEditModelPocoViewModel => VampirewalIoC.GetInstance().GetInstance<AddOrEditModelPocoViewModel>();
        #endregion
    }
}
